﻿<Window x:Class="AgileToDo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AgileToDo" Height="450" Width="750" WindowStyle="None"  Background="{x:Null}"
       AllowsTransparency="True" WindowStartupLocation="CenterScreen"
          MouseLeftButtonDown="DragWindow"  Loaded="Window_Loaded"
        DataContext="{StaticResource ResourceKey=mainWindowVM}"
      Icon="/AgileToDo;component/image/AgileToDo.ico">
    <Window.Resources>
        <Storyboard x:Key="sbImgTran">
            <DoubleAnimation
                    Storyboard.TargetName="imgTransform"
                        Storyboard.TargetProperty="Angle" 
                        By="90" Duration="0:0:.2" 
                        />
        </Storyboard>
        <Storyboard x:Key="sbSyncTran">
            <DoubleAnimation
                    Storyboard.TargetName="syncTransform"
                        Storyboard.TargetProperty="Angle" 
                        By="-180" Duration="0:0:1" 
                        />
        </Storyboard>
    </Window.Resources>
    <Border CornerRadius="5" Background="Black">
        <Canvas>
            <TextBox x:Name="hideTbx" Canvas.Left="3" Canvas.Top="3" Visibility="Hidden"/>

            <TextBlock Text="AgileToDo" Canvas.Left="23" Canvas.Top="3" Foreground="#FFC4C4C4"
                       FontStretch="Normal" FontStyle="Italic" />
            <TextBlock Text="{Binding LoginUser.user, Mode=OneWay}" Canvas.Left="100" Canvas.Top="4" Foreground="#FFC4C4C4" 
                       FontStretch="Normal" FontStyle="Italic" FontSize="10" Opacity="0.5"/>
            <Image Width="30" Height="30" Source="image\Sync.png"
                   ToolTip="同步"
                   Canvas.Left="665" Canvas.Top="-2"  
                   MouseLeftButtonDown="Minimized_MouseLeftButtonDown">
                <Image.RenderTransform>
                    <RotateTransform x:Name="syncTransform"
                                     CenterX="15"
                                     CenterY="15"
                                     Angle="0"/>
                </Image.RenderTransform>
                <Image.Triggers>
                    <EventTrigger RoutedEvent="Image.MouseEnter">
                        <BeginStoryboard   HandoffBehavior="Compose" 
                                           Storyboard="{StaticResource sbSyncTran}"/>
                    </EventTrigger>
                </Image.Triggers>
            </Image>
            <Image Width="20" Height="20" Source="image\minimized.png"
                   ToolTip="最小化"
                   Canvas.Left="695" Canvas.Top="3"  
                   MouseLeftButtonDown="Minimized_MouseLeftButtonDown">

            </Image>
            <Image Width="20" Height="20" Source="image\close.png" 
                     ToolTip="关闭"
                   Canvas.Left="720" Canvas.Top="3" 
                   MouseLeftButtonDown="Close_MouseLeftButtonDown">
                <Image.RenderTransform>
                    <RotateTransform x:Name="imgTransform"
                                     CenterX="10"
                                     CenterY="10"
                                     Angle="0"/>
                </Image.RenderTransform>
                <Image.Triggers>
                    <EventTrigger RoutedEvent="Image.MouseEnter">
                        <BeginStoryboard   HandoffBehavior="Compose" 
                                           Storyboard="{StaticResource sbImgTran}"/>
                    </EventTrigger>
                </Image.Triggers>
            </Image>

            <Frame Width="750" Height="420" Canvas.Top="25" 
                   NavigationUIVisibility="Hidden" x:Name="frame"
                 >
                
            </Frame>
        </Canvas>
    </Border>
</Window>
